package com.sharemarking.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sharemarking.wa.common.entity.BaseEntity;
import com.sharemarking.wa.common.entity.Channel;
import com.sharemarking.wa.common.entity.Post;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author dxy
 */
@Repository
public interface ChannelMapper extends BaseMapper<Channel> {

    @Select("SELECT id,display_name,sort FROM cms_channel WHERE hidden!=1 ORDER BY sort LIMIT #{pageIndex},#{pageSize}")
    List<Channel> getPage(Map<String, Object> map);
    @Select("SELECT COUNT(*) FROM cms_channel")
    Integer getPageTotal(Map<String, Object> map);
    @Select("SELECT id,display_name FROM cms_channel WHERE parent = 1 ORDER BY sort ")
    List<Channel> getChannelName();
}
